package com.base.cn.platform.os.service.course.qa.record;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @author LIZHIPENG
 * @since 2018/5/2
 */
@FeignClient(name= CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface QaGainAttendRecordService extends CourseBaseService {

    /**
     * 分页查询旁听收益记录列表
     * @param currentPage 页码
     * @param params 查询条件
     * @param questionData 是否设置问题数据：true：是，false:否
     * @param userData 是否设置用户数据：true：是，false:否
     * @return Map<String, Object>
     */
    @RequestMapping(contextPath + "/queryGainAttendRecordListPage")
    Map<String, Object> queryGainAttendRecordListPage(@RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                                      @RequestBody Map<String, Object> params,
                                                      @RequestParam("questionData") boolean questionData,
                                                      @RequestParam("userData") boolean userData);

    /**
     * 查询用户问答收益总额
     * @param parans 查询条件
     * @return double总收益
     */
    @RequestMapping(contextPath + "/getUserQaEarning")
    double getUserQaEarning(@RequestBody Map<String, Object> parans);

    /**
     * 提取问答收益到我的账户
     * @param qaGainAttendRecord 提取条件
     * @return Map<String, Object>
     */
    @RequestMapping(contextPath + "/extractEarning")
    Map<String, Object> extractEarning(@RequestBody Map<String, Object> qaGainAttendRecord);

    /**
     * 查询旁听分成收益数量
     * @param gainAttendRecord 查询条件
     * @return 数量
     */
    @RequestMapping(contextPath + "/getGainAttenRecordCount")
    BigDecimal getGainAttenRecordCount(@RequestBody Map<String, Object> gainAttendRecord);


    /**
     * 分页查询旁听收益记录列表
     * @param currentPage 页码
     * @param params 查询条件
     * @return Map<String, Object>
     */
    @RequestMapping(contextPath + "/queryAdminGainAttendRecordListPage")
    Map<String, Object> queryAdminGainAttendRecordListPage(@RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                                      @RequestBody Map<String, Object> params);
}
